<legend class='hyc-legend'>
    <span>菜单编辑</span>
</legend>
<div class="panel panel-default">
    <div class="panel-heading">{{menuObj.info.title || '添加菜单'}}</div>
    <div class="panel-body admin">
        <div class="row">
            <div class="col-md-offset-2 col-md-6">
                <div class="row margin-bottom-10">
                    <div class="col-md-4 text-right">标题：</div>
                    <div class="col-md-8">
                        <input class="input" ng-model="menuObj.info.title" placeholder="请输入标题">
                    </div>
                </div>
                <div class="row margin-bottom-10">
                    <div class="col-md-4 text-right">链接：</div>
                    <div class="col-md-8">
                        <input class="input" ng-model="menuObj.info.href" placeholder="请输入链接">
                    </div>
                </div>
                <div class="row margin-bottom-10">
                    <div class="col-md-4 text-right">图标：</div>
                    <div class="col-md-8">
                        <input class="input" ng-model="menuObj.info.icon" placeholder="请输入图标">
                    </div>
                </div>
                <div class="row margin-bottom-10">
                    <div class="col-md-4 text-right">父级：</div>
                    <div class="col-md-8">
                        <button type="button" class="btn btn-default admin-select select" ng-model="menuObj.info.parentId" bs-options="item.id as item.title for item in menuObj.levelList" bs-select placeholder="---请选择---" max-length-html="个被选中" allText="选中全部" noneText="没有选中">
                        </button>
                    </div>
                </div>
                <div class="row margin-bottom-10">
                    <div class="col-md-4 text-right">banner：</div>
                    <div class="col-md-8">
                        <button type="button" class="btn btn-default admin-select select" ng-model="menuObj.info.bannerId" bs-options="item.id as item.title for item in menuObj.bannerList" bs-select placeholder="---请选择---" max-length-html="个被选中" allText="选中全部" noneText="没有选中">
                        </button>
                    </div>
                </div>
                <div class="row margin-bottom-10">
                    <div class="col-md-4 text-right">角色：</div>
                    <div class="col-md-8">
                        <button type="button" class="btn btn-default admin-select select" ng-model="menuObj.info.roleIds" bs-options="item.id as item.name for item in menuObj.roleList" bs-select placeholder="---请选择---" max-length-html="个被选中" allText="选中全部" noneText="没有选中" data-multiple="1">
                        </button>
                    </div>
                </div>
                <div class="row margin-bottom-10">
                    <div class="col-md-4 text-right">排序：</div>
                    <div class="col-md-8">
                        <input class="input" type="number" ng-model="menuObj.info.sort" placeholder="请输入排序">
                    </div>
                </div>
                <div class="row margin-bottom-10"></div>
                <div class="row margin-bottom-10">
                    <div class="col-md-offset-4 col-md-8 text-center">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="btn btn btn-default btn-block" onclick="javascript: history.go(-1);">返回</div>
                            </div>
                            <div class="col-md-6">
                                <div class="btn btn btn-warning btn-block" ng-click="menuObj.save()">保存</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="panel panel-default" ng-if="menuObj.info.list.length > 0">
    <div class="panel-heading">
        子菜单
    </div>
    <div class="panel-body admin">
        <table class="table table-bordered">
            <tr>
                <th class="text-center">序号</th>
                <th class="text-center">标题</th>
                <th class="text-center">链接</th>
                <th class="text-center">图标</th>
                <th class="text-center">排序</th>
                <th class="text-center">操作</th>
            </tr>
            <tr ng-repeat="item in menuObj.info.list track by $index">
                <td class="text-center">{{$index + 1}}</td>
                <td>{{item.title}}</td>
                <td>{{item.href}}</td>
                <td class="text-center"><i class="{{'fa fa-' + item.icon}}"></i></td>
                <td class="text-center">{{item.sort}}</td>
                <td class="text-center">
                    <a ui-sref="menu-edit({id: item.id})">修改</a>&nbsp;
                    <a href="javascript: void(0);" ng-click="menuObj.remove(item.id)">删除</a>
                </td>
            </tr>
        </table>
    </div>
</div>